package com.han.demo3.before;

/**
 * @ClassName ComputerDemo
 * @Description 描述该类的功能
 * @Author duoduo Han
 * @Date 2024/6/2 14:53
 */
public class ComputerDemo {
    public static void main(String[] args) {
        //创建组件对象
        XiJieHardDisk xiJieHardDisk = new XiJieHardDisk();
        IntelCpu intelCpu = new IntelCpu();
        KingstonMemory kingstonMemory = new KingstonMemory();
        //创建计算机对象
        Computer c = new Computer();
        //组装计算机
        c.setCpu(intelCpu);
        c.setHardDisk(xiJieHardDisk);
        c.setMemory(kingstonMemory);
        //运行计算机
        c.run();
    }
}
